# Sample clustering

library(WGCNA)

args <- commandArgs(trailingOnly = TRUE)

print(args)

exprFilePath = "/Users/zyl/Workspace/hzau/MOIN-Extension-Github/WGCNA-Extension/FemaleLiver-Data/datExpr.csv"

datExpr = read.csv(exprFilePath, stringsAsFactors = FALSE, row.names = 1);

sampleTree = hclust(dist(datExpr), method = "average");
sample_num = nrow(datExpr)

png(
  filename = "/Users/zyl/Workspace/hzau/MOIN-Extension-Github/WGCNA-Extension/FemaleLiver-Data/cluster.png",
  width = ceiling(sample_num/6),
  height = 9,
  units = "in",
  res = 300
)

plot(sampleTree, main = "Sample clustering to detect outliers", sub="", xlab="", cex.lab = 1.5,
     cex.axis = 1.5, cex.main = 2)

dev.off()
